package cn.cvs.service.sysRole.impl;

import cn.cvs.dao.sysRole.SysRoleMapper;
import cn.cvs.dao.sysUser.SysUserMapper;
import cn.cvs.pojo.SysRole;
import cn.cvs.service.sysRole.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service("sysRoleService")
public class SysRoleServiceImpl implements SysRoleService {
    @Autowired
    private SysRoleMapper sysRoleMapper;
    @Override
    public List<SysRole> selectList(SysRole sysRole) {
        try{
            return sysRoleMapper.selectSysRoleList(sysRole);
        }catch (RuntimeException e){
            throw e;
        }
    }

    @Override
    public boolean add(SysRole sysRole) {
        boolean result = sysRoleMapper.add(sysRole) > 0 ? true : false;
        return result;
    }
}
